class Person {
  //？ as is ..
  String name;
  num age;
  Person(this.name, this.age);

  void printInfo() {
    print("${this.name}---${this.age}");
  }
}

main() {
  Person p = new Person("张三", 20);
  // p?.printInfo();
  // if (p is Person) {
  //   p.name = "李四";
  // }
  // p.printInfo();
  // print(p is Object);

  // var p1;
  // p1 = '';
  // p1 = new Person("张三1", 20);
  // p1.printInfo();
  // (p1 as Person).printInfo();
  Person p1 = new Person("张三1", 20);
  p1.printInfo();
  p1.name = "张三222";
  p1.age = 40;
  p1.printInfo();
  p1
    ..name = "张三333"
    ..age = 50
    ..printInfo();
}
